package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type DeviceRequest struct {
	Code          string `form:"code" json:"code"`
	UserID        uint   `form:"user_id" json:"user_id"`
	Name          string `form:"name" json:"name"`
	BoardModel    string `form:"board_model" json:"board_model"`
	Address       string `form:"address" json:"address"`
	BatteryStatus string `form:"battery_status" json:"battery_status"`
	Spec          string `form:"spec" json:"spec"`
	TowerCode     string `form:"tower_code" json:"tower_code"`
	SerialNumber  string `form:"serial_number" json:"serial_number"`
}

func (r *DeviceRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *DeviceRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{
		"code": "required",
	}
}

func (r *DeviceRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *DeviceRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *DeviceRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
